import axios from "axios";


const request = axios.create({
    // timeout: 10000,
    baseURL: '/api',
})
request.interceptors.request.use((request) => {
    // 从 localStorage 里取出token，加到请求头里（headers）
    //@ts-ignore
    request.headers.token = localStorage.getItem('token')

    // 一定要return request 
    return request
})

export default request